package com.kadron.users;

import com.kadron.datamodel.KModel;
import com.kadron.entity.User;
import com.kadron.entity.UserImage;

public class KUserModel implements KModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6992411340935846064L;
	
	private User user;
	private UserImage img;
	private Long kadrons;
	
	public KUserModel(User user, UserImage image, Long kadrons) {
		super();
		this.user = user;
		this.img = image;
		this.kadrons = kadrons;
	}

	@Override
	public long getId() {
		return user.getId();
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public UserImage getImg() {
		return img;
	}

	public void setImg(UserImage image) {
		this.img = image;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (user.getId() ^ (user.getId() >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		KUserModel other = (KUserModel) obj;
		if (user.getId() != other.user.getId())
			return false;
		return true;
	}

	public Long getKadrons() {
		return kadrons;
	}

	public void setKadrons(Long kadrons) {
		this.kadrons = kadrons;
	}
	
}
